package com.hrs.config;

import com.hrs.interceptors.LoginInterceptor;
import com.hrs.interceptors.RequestLimitInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 计算机系 ITAEM 摆渡人
 * @description
 * @date 2022/11/20 22:53
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;
//    @Autowired
//    private RequestLimitInterceptor requestLimitInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor).addPathPatterns("/**");
//        registry.addInterceptor(requestLimitInterceptor).addPathPatterns("/**");
    }
}
